package com.py.apis.article;

import com.py.model.article.dtos.ArticleDto;
import com.py.model.behavior.dtos.LikesBehaviorDto;
import com.py.model.behavior.dtos.ReadBehaviorDto;
import com.py.model.behavior.dtos.UnLikesBehaviorDto;
import com.py.model.common.dtos.ResponseResult;
import com.py.model.moment.dtos.CommentSaveDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-article"/*,fallback = IArticleClientFallback.class*/)
public interface IArticleClient {

    /**
     * 保存APP文章
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/save")
    ResponseResult saveArticle(@RequestBody ArticleDto dto);

    /**
     * 文章点赞
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/likes")
    Integer articleLikes(@RequestBody LikesBehaviorDto dto);

    /**
     * 文章阅读量
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/read")
    Integer articleRead(@RequestBody ReadBehaviorDto dto);

    /**
     * 文章不喜欢
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/un_likes")
    Integer articleUnLike(@RequestBody UnLikesBehaviorDto dto);

    /**
     * 查询文章是否可评论
     * @param commentSaveDto
     * @return
     */
    @PostMapping("/api/v1/article/query")
    public boolean query(@RequestBody CommentSaveDto commentSaveDto);
}
